//index.js
//获取应用实例
const app = getApp()

Page({
  data: {
    imgUrls: [
      '/image/111.jpg',
      '/image/222.jpg',
      '/image/333.jpg',
      '/image/444.jpg'
    ],
    indicatorDots: false,
    autoplay: true,
    interval: 5000,
    duration: 1000,
    movie:null,
  },
  //事件处理函数
  bindViewTap: function() {
    wx.navigateTo({
      url: '../logs/logs'
    })
  },
  onLoad: function () {
   this.loadMovie();
 
  },
  loadMovie(){
    wx.showToast({
      title: '正在加载',
      icon:'loading',
      duration:10000
    })
  let thispage=this;
  wx.request({
    url: 'http://api.douban.com/v2/movie/in_theaters', //仅为示例，并非真实的接口地址
    method: 'GET',
    header: {
      'content-type': 'json' // 默认值
    },
   
    success: function (res) {
      console.log(res.data);
      let subjects=res.data.subjects;
      thispage.setData({movie:subjects})
        wx.hideToast();
    }
  })
  },
onShareAppMessage(options){
return{
  title:'豆瓣电影',
}
}

})

